package com.kucai.yifaqapp.widget;

import android.app.Activity;
import android.content.Intent;
import android.os.Bundle;
import android.support.annotation.Nullable;
import android.view.View;
import android.widget.ImageView;
import android.widget.LinearLayout;

import com.bumptech.glide.Glide;
import com.kucai.yifaqapp.R;
import com.kucai.yifaqapp.ui.activity.WebActivity;

/**
 * Created by admin on 2018/12/26.
 */

public class shouyehbdialog extends Activity {
    //展示红包
    private ImageView close_hb;
    private ImageView hongbao;
    private String url;

    @Override
    protected void onCreate(@Nullable Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.shouyehongbao);
        getWindow().setLayout(LinearLayout.LayoutParams.MATCH_PARENT, LinearLayout.LayoutParams.WRAP_CONTENT);
        hongbao = findViewById(R.id.hongbao);
        close_hb = findViewById(R.id.close_hb);
        url = getIntent().getStringExtra("hb_url");
        Glide.with(this).load(R.mipmap.new2019).asGif().into(hongbao);
        close_hb.setOnClickListener(new View.OnClickListener() {
            @Override
            public void onClick(View v) {
                finish();
            }
        });
        //开始抢红包
        hongbao.setOnClickListener(new View.OnClickListener() {
            @Override
            public void onClick(View v) {
                Intent intent = new Intent(shouyehbdialog.this, WebActivity.class);
                Bundle bundle = new Bundle();
                bundle.putString("url", url);
                bundle.putString("title", "红包");
                intent.putExtras(bundle);
                startActivity(intent);
                finish();
            }
        });
    }
}
